home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / adduser / common.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-04  |  2.5 KB  |  83 lines

  1. /*
  2.  * common.h --
  3.  *
  4.  *    Shared declarations for adduser and deleteuser.
  5.  *
  6.  * Copyright 1991 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that this copyright
  10.  * notice appears in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /sprite/src/admin/adduser/RCS/common.h,v 1.2 91/06/04 16:52:10 kupfer Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _COMMON
  19. #define _COMMON
  20.  
  21. #ifdef __STDC__
  22. #define _HAS_PROTOTYPES
  23. #define _HAS_VOIDPTR
  24. #endif
  25.  
  26. #include <cfuncproto.h>
  27. #include <pwd.h>
  28.  
  29. /* 
  30.  * Don't use const yet; Sprite isn't really converted to use it yet.
  31.  */
  32. #define CONST 
  33.  
  34. #define BUFFER_SIZE         0x100
  35.  
  36. #ifdef TEST
  37. #define PASSWD_FILE    "test/passwd"
  38. #define PASSWD_BAK    "test/passwd.addeluser.BAK"
  39. #define PTMP_FILE    "test/ptmp"
  40. #define    MASTER_PASSWD_FILE    "test/master.passwd"
  41. #define MASTER_BAK    "test/master.addeluser.BAK"
  42. #define ALIASES        "test/aliases"
  43. #define ALIASES_TMP    "test/aliases.addeluser.tmp"
  44. #define ALIASES_BAK    "test/aliases.addeluser.BAK"
  45.  
  46. #else /* !TEST */
  47. #define PASSWD_FILE    _PATH_PASSWD
  48. #define PASSWD_BAK    "/etc/passwd.BAK"
  49. #define PTMP_FILE    _PATH_PTMP
  50. #define    MASTER_PASSWD_FILE    _PATH_MASTERPASSWD
  51. #define MASTER_BAK    "/etc/master.addeluser.BAK"
  52. #define ALIASES        "/sprite/lib/sendmail/aliases"
  53. #define ALIASES_TMP    "/sprite/lib/sendmail/aliases.addeluser.tmp"
  54. #define ALIASES_BAK    "/sprite/lib/sendmail/aliases.addeluser.BAK"
  55. #endif /* !TEST */
  56.  
  57. /* 
  58.  * This is the directory where everyone's home directory is 
  59.  * registered.  However, instead of actually putting the home directory 
  60.  * here, we put the home directory on a separate partition and put a 
  61.  * symbolic link here.
  62.  */
  63. #ifdef TEST
  64. #define USER_DIR    "test"
  65. #else
  66. #define USER_DIR    "/users"
  67. #endif
  68.  
  69. extern int checkNumber _ARGS_((char *buf));
  70. extern void getPasswd _ARGS_((char *p));
  71. extern void getNumber _ARGS_((CONST char *prompt, char *buf));
  72. extern char *getShell _ARGS_((void));
  73. extern void getString _ARGS_((CONST char *forbid, CONST char *prompt,
  74.                   char *buf));
  75. extern int makedb _ARGS_((char *file));
  76. extern int raw_getchar _ARGS_((void));
  77. extern int rcsCheckIn _ARGS_((char *file, char *logMsg));
  78. extern int rcsCheckOut _ARGS_((char *file));
  79. extern void SecurityCheck _ARGS_((void));
  80. extern int yes _ARGS_((char *prompt));
  81.  
  82. #endif /* _COMMON */
  83.